nullpointer issue fixed. working on fixing bugs