Set db to null at the end of login