added http error cathing