some fixes, added button checks