minor adjusment

just to not forget about it, using the state to get the right lenght