changed placement of initdims if statement