fixed some problems, still NullPointerException