correcting naming and adding the error interrupt handling.