added OSError to ctx_error_handler
moved systray register one row down