converted instruction fucntion to check local storage