add application controal codes
fix bugs
fix bugs
fix bugs