Added better handling of error states.Now interrupt and syntax problems should be more covered