bug in endpoint method.. sets endpoint to nil after first use