fixing drain detection -- was not working if limit was set to 1