Fixed #1 by changing function signature. Thanks @adi- !