fix suggested by egreg