Fixed function put in wrong place