small buggfixes with nullpointer exeption