fix bug in factorial when variable is a long instead of an int