declare function before using it