Good evening, Parsa. After running some tests, there may be several reasons why your drone is no longer flying properly. Although you did mention changing the motors, I'd still recommend checking this video, which covers some common issues, including motor and propeller orientation, and hardware connections.
Other reasons for why the motors may not be functioning properly may be due to the battery itself; it's possible that your battery may not be running at maximum capacity, which can be determined by seeing if it has started to puff out. You can test this by removing the battery and placing it on a flat surface, sticker-down. Press down on one end of the battery and see if it rocks back and forth. If so, your battery has started to puff out, and thus the drone is unable to achieve maximum power.
Please let us know which of these methods you tried, including which version of the CoDrone library you are using, and we would be assist to help you further.