Delete/replace .png in a Filename does not work

For some reason I'm ending up with filenames like filename.png.pdf and I want to delete the .png from the filename.
I have a hazel rule:
1. If name contains ".png"
2. Rename with pattern [name][extension] while in name I replace .png with nothing.

Can anybody help me, why this is not working? Or is there a better way to do this. Perhaps there is a problem with recognizing .png as part of the file name, not the ending. But the detection works fine.
I have a hazel rule:
1. If name contains ".png"
2. Rename with pattern [name][extension] while in name I replace .png with nothing.

Can anybody help me, why this is not working? Or is there a better way to do this. Perhaps there is a problem with recognizing .png as part of the file name, not the ending. But the detection works fine.