Fix bug & rename function