make length dynamic