edited toggle function

Signed-off-by: Jakub Nacik <jakub.nacik@nbdesigns.sk>