fixing structure related bugs