moved error handling out of context type and into primary webpics 'main' code