Fixed nullpointerexception (Hopefully)