Added onSavedInstance & Fix logic