making some modifications so GUI will work better