fixed more functions returning bad records