fixed bugs on manager page and other db stuff