Unable to logout correctly after wp-login file was modified

After a bit of research I’ve fixed the problem I had with the redirect after logout. I’ve added this code to my functions file and it will use two filters to modify the default beahviour of wordpress after an user do the logout

/* Logout URL Fix */
function custom_logout_url( $logout_url, $redirect ) {
    $logout_url = home_url( '/access.php?action=logout' );
    $logout_url = wp_nonce_url( $logout_url, 'log-out' );
    return $logout_url;
}
add_filter( 'logout_url', 'custom_logout_url', 10, 2 );

function custom_redirect_after_logout() {
    if ( ! is_admin() ) {
        wp_safe_redirect( home_url() );
        exit();
    }
}
add_action( 'wp_logout','custom_redirect_after_logout' );

I will write a plugin so in future I will be able to get all things in place without touching the theme functions file.