moved print message on shell terminate