Finally fixed queue bug