fixing delete functionality and rushed tests