it gives httpresponse error without thw second else