add conditional for view mode