Added checking on 'errors', instead of exit if an error occured, because sourcing gd, so it's can change the directory, also sources the exit-command.