Fixing scaling and qr scanning