Bedd help! Bad motor?

The drone its made off spare parts, its a lightweight 5" on 4s battery, flys great but after some flips ends up rolling to the right, some times recovers, other times falls to the ground. Its this a bad motor? Bad esc? Thanks