alert blocks the entire process so I would like to avoid using it anywhere.