fix the undefined storage bug