Added remove the sg/sch functionality if invalid and improved guardian errors