fixed edge case bug in migrations controller