Add catch for NullPointerExcetion