added alert window in case of errors