changed list_add to list_add_head to prevent conflict with mysql list_add function