Added input detection to common init