fixed match bugs