Bugfixed a nullPointerException