Fixed curl error. Edited code so it takes  argument into consideration