fixed bug with check