fixed issue that occurred after merging with jason's code