Fixed error if having is not set