updated error checking in class style_wrapper