Getting seg fault. trying to make class to handle buttons