fixing bug with enqueue