updated as per #650