check if connection is still established
bugfix: struct controller is a class in the meantime
bugfix: wrong length calculation
removed typename in typedef