Add protect code for curl handle