make using iam optional. support keepalive function