Minor - ID is saved in storage

moved scope variable so that ID is saved across sessions