add check for localStorage