remove undefined error in console