Changed based on comments and make its behaviour equal to the Windows version