fix for new interface

much cleaner and clear to understand