Change -1 to nil when queue is empty