Fixing onQueueEmpty bug issue #933

This doesn't solve the multple call problem, but it wont throw error on the console.