more robust object checking