use cURL library in better way