fix bugs and add js validation to login page