Fixed bug with selecting inputs
Add delete func.