Remove open/close database hack