Change the code to remove warning in portal_error_log