adding keepalive mechanism for database connection