Fix if-else bug with studio redirect