added alert box functionality