plugged_in function