You don't necessarily need to add something. What you need to do is to debug your program.
Start by asking yourself: why don't I get the behavior I expected? What could I do wrong?
When you are using some method to do something, make sure this is indeed the intended way of doing it: read the documentation, look at the source code under the hood, have a look at how other examples do it, and why your program is different.