actionlistener
fixed a minor error with double typecasting