added tests & sanitizing parameters