tyied to fix runtime error