Resolves #17

Updated the run method to check for array key existence before trying to use it.