Added - basic authentication and closing connection