removed alerts and preventDefault