bug fixes and add new methods