fixed 'invalid selection' bug. thanks for the inspiration apple.