add error_code to return value in logout