fixed non object error
added delete method
Merge pull request #10 from AndreasHeiberg/master

Fixed critical bug and added delete method