fixed minor bug. Thanks Simon