Fixed a bug in my Functions