issue #1196 and some optimizations
Merge pull request #1203 from conejoninja/runalert

issue #1196 and some optimizations