Fixed edge-case bug where segue would occur before button-clicking function did