using one curl resource instead of two