added proper multi-mode support

Signed-off-by: Cthulhux <git@tuxproject.de>