fixed issues with enqueue