working with gui, but buggy as hell