fix toppage code