Add logic for buttons enabling