fixed add method and added exceptions