coded several environments but device still unstable