added defsive move logic