Before adding gui