monitor: fix the wrong order of releasing keys