fixed bug in tryNumber function