establish_connection in models