fix apply pattern ambiguity