Fixed issue with command queue not working correctly