I am not sure what's wrong since I cannot test it fully without a valid username and password, of course I always get an 'invalid' error. Could it be that the form has a different index?