removed bug with data lenght check