added presence detection