small fix in chances function