Fixed issue where code was out of order. Cannot call an undefined fn.