fixed compatibility bug with undefined localStorage values