added $custom_url variable for use throughout