Fixing ^ vs ~ issue