implemented error handling during initialization with 'goto mechanism'