fixed funtions not returning anything error