Fixing bugs and improve GUI