Fixed db stuff hopefully