added queue functionality