found an issue in db functions. fixed it