Make sure to convert role to number before processing