Forgot to mention that the script needs execute permissions