Strange Problem while controlling motors with MOSFET

Thanks for the explanation! I was not sure of the working principle of the MOSFET, I shall try it out with a ground!