I think I fixed the nullpointer exeption, removed some unused parameters