Changed code to handle clear console as a UI job.