fixed patient database problem