test attributes before attempting to write