corrected button functions