done issue #152
removed dynamic_cast
fixed code style