started working on preventing the error