Fixing tick function