wip
fixing nullpointer exceptions