trying to fix the match bug