Solved key nullpointer issue