Fixed all functions