Invert logic as suggested by rivera-ernesto