Added locking to InputController to prevent werid behaviour