Fixes double allocation