made cURL function compatible with php 5.3 and on