process_connection method updated