added errorMsg declaration, removed weinre tag