Added default value to invert if no value is passed