add empty check

check if queue is empty
Merge pull request #1 from RathnaS/master

add empty check