merge changes from @rbzn