added new parameter to disable loop closure