Added a boolean to control remote/local