add more error checking to details route