Modifies the functions to remove some errors
Finally object selection is working