fixed init dims problem but inefficiently