made json conversion from gui more correct