How to get custom fields in a post when published

add_action('publish_post','create_custom_field')

function create_custom_field ($post_id) {
    global $wpdb;
    if ( current_user_can('contributor') ) {
        if(get_post_meta($post_id,'custom_field_1',true) == '1'){
            add_post_meta($post_ID,'submit','1',true);
            return $post_id;
        }

        return $post_id;
    }
}