fixed bug in error() not terminating execution