protect around error in studio