rail detector