added correct attribute checking