now also works in object mode. but with probably ugly code...