Fix scripts not being run if message is not shown