moved logic for replacing a dashboard widget to dashboard model