fixes all problems with registration to database