ADDED emit error events and output error message
Version 1.0.0