add maintop position in template