fix bug that N could only be interger