Fixed problem with case statement