cannot exit loop