remove undefined error on console