check for valid targets when flying

closes #4972
Merge pull request #5001 from Mailaender/fly-valid-target

Added checks for valid targets when flying