fixed an issue with database reconnection

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>