fixes atTarget bug