before connecting to database