made it robuster at right place this time