Fixing bug where start pattern is not found