fix read button function