fix behavior for factorials