adding javascript to trigger login