reason for the crash: infinite loop