Logic for custom buttons