add function staff leave dectecting