updated the view to fix the null check