fixed fail() method