messing up with curl and non-static functions