check return from curl