fixed credentials binding and removed "this" in anon function