Updated add custom post function