updated set_attrs & corrected some errors