added printing for error