red code

logic fix & few view