Updated to fix a bug