added queue checking