Updated swithc to deal with fail statements