Iraq president optimistic over security despite ongoing attacks