solution suggested by @janv