fixed requeue function