Fixed function call order