Logic for showing control buttons