fix undefined variable issue and css issue