add appInit function for init