Fixed undefined offset

Fixed "Undefined offset: 1 on line 103". I did not verify if the variable was set before trying to use it, causing errors on some servers.