fix application exit problem in lua5.1

Seems the logic of the expression is wrong.