with application quit function