The listeners work but exception is thrown