File exist bugs fixed