fixing bug in ENdless Queue