added override keyword
using dynamic cast