added to readButtonpressed