Mochad -> fixed bug with function