replaced alerts with displayWarnings