Fix a logical error about application management

Signed-off-by: Manson Li <manson.li@matchstick.tv>