Added timeout parameter to database connections