fixed script so that if parameters are empty string it will still work