passing the pointer to another funtion