fixed some bugs. And  redefined some app project template files.