Added led management function