Added error checking to add a cast and altered the route