fixed #1 and a Queue syncrhonization bug