Fixed js so that it doesn't reset item status on each load