Added edit functionality. Fixed login validation