added handling error in get_by_slug