added screen format and more error handling during processing