better implementation of the action sheet buttons