fix diagram layout