fixed scoping issue with editing an existing task