Removed some blocking sql calls from gui