now buttons work even without GUI
 + other small fixes