use inuputqueue for better input handling