fixes queuing issues #4540 and #5427