button creation bug. not returning the needed structure