fix crash on initial guess due to input not being integer

Signed-off-by: Liew Zhao Wei <zhaoweiliew@gmail.com>
fix the crash for all the other instances too

Signed-off-by: Liew Zhao Wei <zhaoweiliew@gmail.com>