Changed canExecute and canExecuteExp to use cast