changed conditions to deal with no count limit present