fix appdelegate