Fixed system error code in if condition