fixed bug regarding the inputs of a function