Fixing regex bug