using exit method