fixed some errors and added curl alternative