cleaned up appdelegate