fixed view javascript bug