added curl and small bugfixes