added http exception handling