Adjust listener to actually execute on process end