Put quotes around `$@` like `"$@"` otherwise arguments with spaces will be expanded to multiple arguments (yeah it's counter-intuitive that that's how you fix it, shell syntax is crazy).