working on monitor logic