fixing db bug