Fixed key issue

Used to be a nullpointerexception