simpler implementation of bugfix #2