changed to selector instead of case statement