Keyboard opens when using input variable for http request

Hey guys,
I´m trying to code my first video addon using python.
The addon should do the following:
1. Open the keyboard, and ask for an input
2. call an api with the input variable as last parameter
3. Give out the result as a list

It works, but quickly after the list will be created, the keyboard opens again and my error message (if not path) pops up.
The Kodi log says that it is impossible to combine a string with an boolean.
If i write the search parameter directly in the source code, it works perfectly.

Hope for help Smile