problem with accessing database second time