improved object checking