getting database working