Fixed problem - didnt save state when metadata was loaded