fix locking the database by just opening it