Added keyCommand queue to avoid thread concurrency