make signature compat with JS promises, closes #7