Adding support for app quit