Stored function creation working