The record count is now displaying correctly. Some clean up of code.