Fixing data sending bug