Fixed javascript error on discovery view