commit before changing button funcionality