loans bug fixes