fixed bugs with queue security