fixed bug with main