fixed a bug in lending