login logic
fix cast  exception