Added functions for incrementing and decrementing reference count